################################################################
# 这个Docker是wordpress的dockerfile
################################################################
FROM ubuntu

MAINTAINER swumao

# 换源

RUN cp /etc/apt/sources.list /etc/apt/sources.list.bk

COPY sources.list /etc/apt/sources.list

# Update apt-get

RUN apt-get update

# Install Apache Server

RUN apt-get install -y apache2

# Install PHP

RUN apt-get install -y php5 libapache2-mod-php5

# Install Mysql

RUN apt-get install -y mysql-server

# Let apache support php

RUN apt-get install -y libapache2-mod-auth-mysql

RUN apt-get install -y php5-mysql

# Remove the default config file

RUN rm -v /etc/apache2/apache2.conf

# Add our config file 

ADD apache2.conf /etc/apache2/

# Set Env

ENV APACHE_RUN_USER daemon

ENV APACHE_RUN_GROUP daemon

# Expose ports

EXPOSE 80

# Copy codes to the web root dir

COPY wordpress/ /var/www/html/

CMD service apache2 start